package ckw.database;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

public class Voter extends core.modules.database.SuperVoter implements Serializable {

	private static final long serialVersionUID = 3806160431378079261L;

	private OKW okw;
	private Set<VotersList> votersLists = new HashSet<VotersList>();
	private Set<SummaryPackage> summaryPackages = new HashSet<SummaryPackage>();

	public Voter() {
		super();
	}

	public Voter(String name, String surname, String address,
			String identificationField) {
		super(name, surname, address, identificationField);
	}
	
	public Voter(String name, String surname, String address,
			String identificationField, OKW okw) {
		super(name, surname, address, identificationField);
		addToOkw(okw);
	}

	public OKW getOkw() {
		return okw;
	}

	public void setOkw(OKW okw) {
		this.okw = okw;
	}

	public void addToOkw(OKW okw) {
		this.setOkw(okw);
		okw.getVoters().add(this);
	}

	public void removeFromOkw(OKW okw) {
		this.setOkw(null);
		okw.getVoters().remove(this);
	}

	public Set<VotersList> getVotersLists() {
		return votersLists;
	}

	public void setVotersLists(Set<VotersList> votersLists) {
		this.votersLists = votersLists;
	}

	public Set<SummaryPackage> getSummaryPackages() {
		return summaryPackages;
	}

	public void setSummaryPackages(Set<SummaryPackage> summaryPackages) {
		this.summaryPackages = summaryPackages;
	}
}
